home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / dev / amos / AMOSList0993.lzh / AMOSLIST / 000236_amos-request@svcs1.digex.net_Fri Sep 24 08:36:38 1993.msg < prev    next >
Internet Message Format  |  1993-10-03  |  5KB

  1. Received: from nextsun.INS.CWRU.Edu by access.digex.net with SMTP id AA25554
  2.   (5.65c/IDA-1.4.4 for <mcox@access.digex.com>); Fri, 24 Sep 1993 08:36:36 -0400
  3. Received: from svcs1.digex.net by nextsun.INS.CWRU.Edu with SMTP (5.65b+ida+/CWRU-1.5.2-freenet-gw)
  4.     id AA00543; Fri, 24 Sep 93 08:36:24 -0400 (from amos-request@svcs1.digex.net for mcox@access.digex.com)
  5. Received: by svcs1.digex.net id AA00251
  6.   (5.65c/IDA-1.4.4 for amos-list-out); Fri, 24 Sep 1993 08:15:05 -0400
  7. Received: from access.digex.net by svcs1.digex.net with SMTP id AA00239
  8.   (5.65c/IDA-1.4.4 for <amos-list@svcs1.digex.net>); Fri, 24 Sep 1993 08:15:01 -0400
  9. Received: from wraith.cs.uow.edu.au by access.digex.net with SMTP id AA20453
  10.   (5.65c/IDA-1.4.4 for <amos-list@access.digex.net>); Fri, 24 Sep 1993 07:56:07 -0400
  11. Received: by wraith.cs.uow.edu.au
  12.     (5.65c/IDA-1.4.4); id AA17318; Fri, 24 Sep 1993 20:07:32 +1000
  13.     (from u9147063 for amos-list@access.digex.net)
  14. From: Richard Barry Ling <u9147063@cs.uow.edu.au>
  15. Message-Id: <199309241007.AA17318@wraith.cs.uow.edu.au>
  16. Subject: Looking for better way
  17. To: amos-list@access.digex.net (AMOS User group)
  18. Date: Fri, 24 Sep 1993 20:07:31 +1000 (EST)
  19. Mime-Version: 1.0
  20. Content-Type: text/plain; charset=US-ASCII
  21. Content-Transfer-Encoding: 7bit
  22. Content-Length: 3174      
  23. Status: RO
  24.  
  25. > I am writing a small LOGO interpreter for my Daughter, to match the one
  26. > she uses at school.  I'm using AMOS Creator on an A3000.
  27. > I need to have a small graphic element (the turtle) move over another
  28. > large graphic without affecting it.  A sprite exhibits just these
  29. > characteristics, and would be a wonderful choice except that I want the
  30. > turtle to always point in the direction of motion and change color
  31. > (a chamelian turtle?) when the drawing color is changed.  I don't know
  32. > how to do this without storing MANY (all possible) sprite images.
  33.  
  34. I can see a couple of easy solutions to this problem.
  35.  
  36. For the colour change, why store huge numbers of images of the turtle in
  37. each colour, when you can change the RGB value of the sprite?  Use colour
  38. number 1 for the turtle images, and you can instantly chameleonize (?) the
  39. turtle to match the current drawing colour using Colour 17,$RGB.
  40.  
  41. For the rotation, one idea is to store a sprite of the turtle pointing in
  42. each direction, stepping by a certain angle.  You certainly won't need 360
  43. images of the turtle rotating by 1 degree increments - you'll never notice
  44. the change from one image to the next.  You may find that increments of say
  45. 10 degrees are plenty, giving only 36 images needed.  You then use arithmetic
  46. to convert the angle in degrees to the image number you want.
  47.  
  48. Alternatively, you can generate the sprite for a particular angle on the
  49. fly.  Set up a tiny invisible screen, and each time the turtle rotates, draw
  50. the turtle onto the hidden screen using the trig functions.  Grab it with
  51. the Get Sprite command, and you're away.  This should be plenty fast
  52. enough.  Using this method, combined with the palette change mentioned
  53. before, you don't need to store any sprites with your program at all!  Or,
  54. you can use this method to initially generate your sprites for each angle,
  55. and store them along with your program - it would sure beat drawing them by
  56. hand!
  57.  
  58. > Alternatively, is there another method?  I have successfully done it
  59. > using dual playfield... drawing the turtle on one screen and the graphics
  60. > on a second... but I am limited (by AMOS) to low resolution.  I want to
  61. > use 640x400 (hires) interlaced with at least 8 colors.  (After all,
  62. > the Amiga version MUST look better than the Apple version, right?)
  63.  
  64. You can use the low-res sprite turtle on a high-res screen, but if you want
  65. a high-res turtle too, you'll need to use bobs.  Everything I write above
  66. will work for bobs too, except the colour numbers - you could draw your bob
  67. in, say, colour 7 (assuming an 8-colour screen) and use Colour 7,$RGB to
  68. change its colour to the current drawing colour.  Of course you won't be
  69. able to use colour 7 for much else, since it will change all the time.  If
  70. you need more colours, try using a 16-colour screen.
  71.  
  72. > Any help is appreciated!
  73. >                                              Mark
  74.  
  75. I hope this does!
  76.  
  77. RL.
  78.  
  79. --
  80. This has been a dinosaur-free announcement.
  81.  
  82. ==========================  Generating: .signature
  83.    Richard Ling             - colour analysis... complete
  84.  u9147063@cs.uow.edu.au     - clipping... complete
  85. ==========================  - rendering... 37.6%